# -*- coding: utf-8 -*-
# standard
import os
import sys
import logging

# third

# local
_P_PATH = os.path.dirname(os.path.realpath(__file__))
if _P_PATH not in sys.path:
    sys.path.append(_P_PATH)
from functions import HUEY
from models.huey_tasks import *


"""
@Title:   huey_worker.py
@File: huey_worker.py
@Author: walle 2025年01日17日 09时25分57秒
@Version: 1.0.0
@Desc: 
python venv\Scripts\huey_consumer.py huey_worker.HUEY
"""
from huey.consumer_options import ConsumerConfig



def consumer_main():
    logger = logging.getLogger('huey')
    kw = {
        "scheduler_interval": 1, # 检查间隔
        'work_type': "greenlet",  # default thread or greenlet 
        'workers': 4  # default 1 or 32
    }
    config = ConsumerConfig(**kw)
    config.setup_logger(logger) 
    consumer = HUEY.create_consumer(**config.values)
    consumer.run()
    logger.info("over")
    

if __name__ == '__main__':
    consumer_main()
    pass